#ifndef _UIAPPLICATION_H_
#define _UIAPPLICATION_H_

#include <QStringList>
#include <QObject>

class QGraphicsView;
class UIApplicationDelegate;
class UIWindow;

class UIApplicationPrivate;
class UIApplication : public QObject {
    Q_OBJECT

    public:
        static UIApplication *sharedApplication (void);

    public:
        static QString defaultAppDirectory (void);

    public:
        QStringList arguments (void) const;
        void setArguments (int argc, char **argv);

        UIWindow *keyWindow (void) const;
        void setKeyWindow (UIWindow *window);

        UIApplicationDelegate *delegate (void) const;
        void setDelegate (UIApplicationDelegate *delegate);

        QGraphicsView *screenView (void) const;

    Q_SIGNALS:
        void keyWindowChanged (UIWindow *window);
        void terminated (void);

    public Q_SLOTS:
        void quit (void);

        void load (const QString& fileName, 
                   const QStringList& args = QStringList());
        void loadByName (const QString& appName, 
                         const QStringList& args = QStringList());

    public:
        UIApplication (QObject *parent = 0);
        ~UIApplication();

    private:
        UIApplicationPrivate *d;
};

#endif /* !_UIAPPLICATION_H_ */

